package com.direction.hold.ui;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TabHost;
import android.widget.TextView;
import cn.cheln.explorer.actions.OperationUtil;
import cn.cheln.explorer.beans.ApkInfo;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.config.Config;
import cn.cheln.explorer.config.Constants;
import cn.cheln.explorer.ds.database.SQLManager;
import cn.cheln.explorer.ds.uri.NavigationConstants;
import cn.cheln.explorer.func.AppSrc;
import cn.cheln.explorer.func.setup.PackageInstallManager;
import cn.cheln.support.data.text.xml.SPUtil;
import cn.cheln.support.log.Logs;
import cn.cheln.support.manager.ActivityPool;
import cn.cheln.support.notification.NotifyUtil;
import com.direction.hold.FileApp;
import com.lewa.os.ui.ViewPagerIndicatorActivity;
import com.lewa.os.ui.ViewPagerIndicatorActivity.StartParameter;
import java.io.File;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;

public class SlideActivity extends ViewPagerIndicatorActivity
{
  public static final int TAB_INDEX_CATEGORY = 0;
  public static final int TAB_INDEX_SDCARD = 1;
  public static FileApp activity;
  public static FileApp fileActivityInstance;
  public static boolean firstTimeLaunch = true;
  public static SlideActivity paramActivity;
  public int currFrameId;
  boolean distributeFCFeed = false;
  public int isInOperation = -1;
  boolean launchPathActivity = false;
  public int mDetailType;
  public TabHost mTabHost;
  public TextView sdcardView;
  public int titleHeight;

  public SlideActivity(FileApp paramFileApp)
  {
    activity = paramFileApp;
  }

  public void endJob()
  {
    cn.cheln.explorer.config.RuntimeArg.shouldStopInstall = true;
    PackageInstallManager.getInstance().end(Integer.valueOf(2131034291));
    new Timer().schedule(new TimerTask()
    {
      public void run()
      {
        NotifyUtil.cancel(FileApp.activity, 0);
      }
    }
    , 2000L);
    ActivityPool.getInstance().exit();
  }

  public void onEventDestroy()
  {
    endJob();
  }

  public void postCreate(Bundle paramBundle)
    throws Exception
  {
    new Thread()
    {
      public void run()
      {
        AppSrc.initInstalledApps(SlideActivity.fileActivityInstance);
        OperationUtil.initStrCnst(SlideActivity.fileActivityInstance);
        FileInfo.init(SlideActivity.fileActivityInstance);
        ApkInfo.init(SlideActivity.fileActivityInstance);
        NotifyUtil.cancel(SlideActivity.fileActivityInstance, 0);
        try
        {
          Config.versioncode = SlideActivity.fileActivityInstance.getPackageManager().getPackageInfo("com.lewa.app.filemanager", 16384).versionCode;
          int i = Config.versioncode;
          Boolean localBoolean = null;
          if (i != -1)
          {
            int j = Config.versioncode;
            localBoolean = null;
            if (j > 10)
              localBoolean = (Boolean)SPUtil.getValue(SlideActivity.fileActivityInstance, "file", "Key_Pic_Loading10", Boolean.class);
          }
          if ((localBoolean == null) || (!(localBoolean.booleanValue())))
          {
            new OperationUtil().recursiveDelete(new File(Constants.Thumb_folder));
            SPUtil.putValue(SlideActivity.fileActivityInstance, "file", "Key_Pic_Loading10", Boolean.valueOf(true));
          }
          return;
        }
        catch (PackageManager.NameNotFoundException localNameNotFoundException)
        {
          localNameNotFoundException.printStackTrace();
        }
      }
    }
    .start();
    if (!(this.distributeFCFeed));
    ((TextView)fileActivityInstance.findViewById(2131230839)).setTextSize(1, 22);
    fileActivityInstance.findViewById(2131230840).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramView)
      {
        Intent localIntent = new Intent(SlideActivity.fileActivityInstance, SearchActivity.class);
        localIntent.putExtra("isNew", true);
        SlideActivity.fileActivityInstance.startActivity(localIntent);
      }
    });
  }

  public void preCreate(FileApp paramFileApp)
    throws Exception
  {
    paramActivity = this;
    SQLManager.createFileDB(paramFileApp);
    Logs.setLevel(3);
    NavigationConstants.init(activity);
    PackageInstallManager.isInInstall = false;
    setSwipeFeature(activity);
  }

  public void setEntryActivity(FileApp paramFileApp)
  {
    fileActivityInstance = paramFileApp;
  }

  public void setSwipeFeature(FileApp paramFileApp)
  {
    Intent localIntent3;
    paramFileApp.setContentView(2130903055);
    Intent localIntent1 = paramFileApp.getIntent();
    String str = localIntent1.getAction();
    if ("com.lewa.filemgr.count_start".equals(str))
      this.distributeFCFeed = true;
    if ("com.lewa.filemgr.path_start".equals(str))
      this.launchPathActivity = true;
    ArrayList localArrayList = new ArrayList();
    if (!(this.launchPathActivity))
    {
      if (!(this.distributeFCFeed))
        break label158;
      localIntent3 = localIntent1;
      label70: localIntent3.putExtra("delayloadcontent", true);
      localArrayList.add(new ViewPagerIndicatorActivity.StartParameter(this, CountActivity.class, localIntent3, 2131034115));
    }
    if (!(this.distributeFCFeed))
      if (!(this.launchPathActivity))
        break label170;
    for (Intent localIntent2 = localIntent1; ; localIntent2 = new Intent())
    {
      localIntent2.putExtra("delayloadcontent", true);
      localArrayList.add(new ViewPagerIndicatorActivity.StartParameter(this, PathActivity.class, localIntent2, 2131034117));
      paramFileApp.setupFlingParm(localArrayList, 2130903055, 2131230842, 2131230843);
      return;
      label158: localIntent3 = new Intent();
      label170: break label70:
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     com.direction.hold.ui.SlideActivity
 * JD-Core Version:    0.5.2
 */